The List pageable filtered documents 2.0 AS component
Summary
List documents from an ept category, up to ten XML fields can be used for filtering.
NOTE: There are some security issues with this component, see the
Remarks section for more information
Component properties
Category
AS EPT
Version
2.1
Complies with Xhtml 1.0 / 1.1 rules
Yes
Supported server programming languages
C# Visual Basic.NET
Output content type
block
When to use
This component is typically used in an EPT presentation template when there is a
need to list a number of EPT documents. The documents can optionally be formatted
by using yet another a presentation template. An interesting alternative to this
component is the Script filtered documents
component that offers more fine grained control over the include process and can
offer better performance, the downside is that Script filtred documents requires
programming skills.
Programming interface
List pageable filtered documents 2.0
Version:
2.1
Description:
List documents from a category filtered on one to ten XML fields.
Server language:
c#|vb
The first field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Return only this column, can be usefull in combination with ScriptForRow1 when you
want customized data to be displayed only in one column. All other columns will
be ignored if you set this to true, but you can still use the fields specified as
returnfields in XMLField 2-20.
Optional code for row 1.
Here you can type code that will excute for each row, the value of the current row
is stored in a dictionary called EPTData. The dictionary will contaion keys with
the same name as you specified in the XMLField:s and are returned.
Ex:
If you specified Gender and Name in one of the XMLField:s you can type:
If EPTData("Gender").ToUpper() = "M" Then
Page.Response.Write(Page.Server.HTMLEncode(EPTData("Name")) & " is a male."
Else
Page.Response.Write(Page.Server.HTMLEncode(EPTData("Name")) & " is a female."
End If.
There is one global key named EPTData("documentid") that is containing the id of
the current document.
If you want a lookup category you ca use this function:
CSF_LookUpField(CategoryId, LookUpFieldName, RetFieldName, LookUpValue, (UseApplicationCache),
(ApplicationTimeOut))
To access the Page you must use the Page variable. Ex: Page.Response.Write("").
If the page where the component is included is written in C#, the code must also
be C#. There is also an object called EPTProperties wich contains the properties
RecordCount and PageCount.
The second field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 2. Se description for ScriptForRow1
The third field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 3. Se description for ScriptForRow1
The fourth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 4. Se description for ScriptForRow1
The fifth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 5. Se description for ScriptForRow1
The sixth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 6. Se description for ScriptForRow1
The seventh field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 7. Se description for ScriptForRow1
The eighth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 8. Se description for ScriptForRow1
The nineth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 9. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 10. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 11. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 12. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 13. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 14. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 15. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 16. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 17. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 18. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 19. Se description for ScriptForRow1
The tenth field you want to use either in result criteria or sort.
The data type for this field. Must be specified for correct sorting or viewing.
Warning: you must be sure that all values in this field corresponds to the chosen
data type.
Make link of this field.
Return this field in result
Enable direct edit for this field in web-view. Can not be combined with ScriptForRow
Optional code for row 20. Se description for ScriptForRow1
Optional filter criteria. Here you can type sql criterias using the fields you have
choosen above. Ex: [Country] = 'Sweden'. You must enclose the fieldnames with []
and type them with correct casing.
Title of optional sort column 1. This will create an header for the first column
specified in XMLField1
Title of optional sort column 2. This will create an header that is clickable for
sorting for the second column specified in XMLField2.
Title of optional sort column 3. This will create an header that is clickable for
sorting for the third column specified in XMLField3.
Title of optional sort column 4. This will create an header that is clickable for
sorting for the fourth column specified in XMLField4.
Title of optional sort column 5. This will create an header that is clickable for
sorting for the fifth column specified in XMLField5.
Title of optional sort column 6. This will create an header that is clickable for
sorting for the sixth column specified in XMLField6.
Title of optional sort column 7. This will create an header that is clickable for
sorting for the seventh column specified in XMLField7.
Title of optional sort column 8. This will create an header that is clickable for
sorting for the eight column specified in XMLField8.
Title of optional sort column 9. This will create an header that is clickable for
sorting for the nineth column specified in XMLField9.
Title of optional sort column 10. This will create an header that is clickable for
sorting for the tenth column specified in XMLField10.
Title of optional sort column 11. This will create an header that is clickable for
sorting for the tenth column specified in XMLField11.
Title of optional sort column 12. This will create an header that is clickable for
sorting for the tenth column specified in XMLField12.
Title of optional sort column 13. This will create an header that is clickable for
sorting for the tenth column specified in XMLField13.
Title of optional sort column 14. This will create an header that is clickable for
sorting for the tenth column specified in XMLField14.
Title of optional sort column 15. This will create an header that is clickable for
sorting for the tenth column specified in XMLField15.
Title of optional sort column 16. This will create an header that is clickable for
sorting for the tenth column specified in XMLField16.
Title of optional sort column 17. This will create an header that is clickable for
sorting for the tenth column specified in XMLField17.
Title of optional sort column 18. This will create an header that is clickable for
sorting for the tenth column specified in XMLField18.
Title of optional sort column 19. This will create an header that is clickable for
sorting for the tenth column specified in XMLField19.
Title of optional sort column 20. This will create an header that is clickable for
sorting for the tenth column specified in XMLField20.
Optional attributes for sort header cells
Default sortfield, make sure you have specified this field in XMLFields.
Sort descending.
Optional ptid to use when click on link.
Borderwidth.
CellPadding.
CellSpacing.
Width
Color of odd lines.
Color of even lines.
Link target
Display this text on top only when records was returned, available constants is
$RecordCount$ and $PageCount$.
Display this text on bottom only when records was returned, available constants
is $RecordCount$ and $PageCount$.
Text displayed when no matching data could be found
Document to be inserted when no matching data could be found
Presentation template id for NoRecordDocId
Use pageing. If not set the number of records shown will be limited by value of
the PageSize parameter. A PageSize of 0 will show all available records.
Use pageing on top.
Use pageing on bottom.
Use pageing on bottom and top.
Max number of documents to list on each page.0 = All documents.
Size of range.
Change this if you want more than one pageing per page.
Attributes in table.
Here you can type caption col and colgroup tags.
Attributes in links.
Separator between links
List approved documents. Only browse permission is required.
List drafts only. Read permission is required.
List drafts or approved documents if no draft vas found. Read permission is required.
Edit template for drafts.
Ignores Publishdate, Archivedate and withdrawn status. Can be usefull to list documents
for editing. If this option is set then read permissions is required, not only browse.
Tells if the component chould check for read permission instead of browse.
Check this to change category for filtering depending on current language. Without
this option checked, "UseRoot", "AllowNonMLCParent" and "CheckLangCookie" will have
no effect.
Check this to make the presentation template MLC aware as well. Should be checked
if using presentation template with MLC IsMLCAware checked.
Check this to fetch current language from root document (id in query string), rather
than from the document in which the component is inserted. If no value can be retrieved
from the query string, this option will be ignored.
Unchecking this checkox will cause an error message to be displayed if the root
document or inserted document, whichever you choose to check, is not a member of
any MLC.
Checks in cookie named "CS_Language" for language code to use as current language.
Overrides UseRoot. If no value can be retrieved from the cookie, the component will
try to get a valid language code from the document instead. Is overridden by value
of "lang" in query string.
Do not cache the xml query.
Cache the xml query using application variables. Should not be used in an intranet
with security permissions set for the xml query items.
Timeout in minutes for application cache, 0 = no timeout
List pageable filtered documents 2.0: programming interface
Parameters
Field parameter settings
XMLField1 - XMLField20
The field you want to use either in result, criteria or for sorting.
Data type 1 - Data type 20
The data type for this field. Must be specified for correct sorting or viewing.
WARNING you must be sure that all
values in this field corresponds to the selected data type.
MakeLink1 - MakeLink20
Make link of this field.
ReturnField2InResult - ReturnField20InResult
Return this field in the result
EnableDirectEditing1 - EnableDirectEditing20
Enable direct editing for this field in the web-view. This parameter can not be
combined with ScriptForRowX
ReturnOnlyThisColumn
Return only the first column, this can be useful in combination with ScriptForRow1
when you want customized data to be displayed only in one column. All other columns
will be ignored if you set this parameter to true, however, you can still use the
fields specified as returnfields in XMLField 2-20.
ScriptForRow1 - ScriptForRow20
Optional. A value that specifies the ASP.NET code that will excute for each data
row that is returned.
The data of the current row is stored in a dictionary called EPTData. EPTData
will contain keys with the same name as you specified in the XMLField:s and which
also have ReturnFieldXInResult set to true.
Example:
If you specified Gender and Name in one of the XMLField:s you can type:
if (EPTData["Gender"].ToUpper() == "M")
Page.Response.Write(Page.Server.HTMLEncode(EPTData["Name"]) + " is a male.";
else
Page.Response.Write(Page.Server.HTMLEncode(EPTData["Name"]) + " is a female.";
If EPTData("Gender").ToUpper() = "M" Then
Page.Response.Write(Page.Server.HTMLEncode(EPTData("Name")) & " is a male."
Else
Page.Response.Write(Page.Server.HTMLEncode(EPTData("Name")) & " is a female."
End If
There is one global member named documentid which contains the document
id for the current row. This data can be retrieved with by typing:
EPTData("documentid")
EPTData["documentid"];
If you want to use a lookup category you can call the CSF_LookUpFieldmethod.
To access the page on which the component is included in, you must use the Page
property. Ex: Page.Response.Write("").
If the page, where the component is included, is written in C#, the ScriptForRowX
must also use C#. Hence, if the page is written in VB, the ScriptForRowX
must also use VB.
In addition to all above, there is also an object called EPTProperties
wich contains the properties RecordCount and PageCount.
FilterCriteria
Optional filter criteria.
This filter criteria is the WHERE part of a regular SQL query. You can use any of
the fields you have specfied above but their names must be enclosed with []. Since
the underlying data is stored in xml, all field names are case sensitive.
For example:
[Country] = 'Sweden'
([Age] > '18' AND [Sex] = 'F') OR ([Age] > '20' AND [Sex] = 'M')
Sorting columns
SortColumn1
Title of optional sort column 1. This will create an header for the first column
specified in XMLField1
SortColumn2 - SortColumn20
Title of optional sort column 2-20. This will create an header that is clickable
for sorting on the column specified in XMLField2 - XMLField20.
SortCellAttributes
Optional attributes for sort header cells
Sorting settings
DefaultSortField
Default sortfield, make sure you have specified this field in the XMLFields.
SortDesc
Sort descending.
Presentation template
PTID
Optional ptid to use in the href attribute of the document links.
Table settings
TableBorder
Borderwidth.
TableCellPadding
CellPadding.
TableCellSpacing
CellSpacing.
TableWidth
Width
RowColor1
Color of odd lines.
RowColor2
Color of even lines.
Target
Target
Link target
Text labels and presentation>
RecordTextTop
This text is displayed at the top, but only when one or more records was returned.
Available constants that can be used in the text is $RecordCount$ and $PageCount$.
RecordTextBottom
This text is displayed at the bottom, but only when one or more records was returned.
Available constants that can be used in the text is $RecordCount$ and $PageCount$.
NoRecordText
A Text that will be displayed when no records is returned.
NoRecordDocId
An id for a document that will be inserted when no records is returned.
NoRecordDocPTId
A presentation template id to use for NoRecordDocId.
Pageing
settings
UsePageing
Specifies whether to use paging or not.
Pageing options
One of the following options:
Top
Use pageing on top.
Bottom
Use pageing on bottom.
Both
Use pageing on bottom and top.
PageSize
Max number of documents to list on each page. A PageSize of 0 will show all available
records. If UsePaging is not checked, the number of records shown will
be limited by the value of this parameter.
RangeSize
This parameter controls the number of paging-links that will be displayed for each
range.
For example, a rangesize of 3 will initially display the links:
123
>>>
UniqueID
Change this parameter if you want to use paging on more than one component at this
page.
TableAttributes
Attributes in table.
ColProperties
Here you can type caption col and colgroup tags.
LinkAttributes
Attributes for paging links.
Handle posted pages
Leading page range text
The text to display before the paging-links.
Link separator text
Separator between links
Link prefix text
The text to display at the beginning of each link.
Previous page range text
The text to display in the link to the previous range.
Previous page text
The text to display in the link to the previous page.
Next page text
The text to display in the link to the next page.
Next page range text
The text to display in the link to the next range.
Ignore publishstatus and list drafts
List approved documents
List approved documents. Only browse permission is required.
List drafts
List drafts only. Read permission is required.
List drafts or approved documents
List drafts or approved documents if no draft vas found. Read permission is required.
EditTemplateID
Edit template for drafts.
Ignore publish status
Ignores Publishdate, Archivedate and withdrawn status. Can be usefull to list documents
for editing. If this option is set then read permissions is required, not only browse.
Check for read permission
Check this if you want the component to check for read permission instead of browse
permission.
MLC settings
IsMLCAware
Check this if you want to change category for filtering depending on the current
language. Without this option checked, "UseRoot", "AllowNonMLCParent" and "CheckLangCookie"
will have no effect.
CheckPTID
Check this if you want to make the presentation template MLC aware as well. This
parameter should be checked if you are using a presentation template that has MLC
IsMLCAware checked.
UseRoot
Check this to fetch the current language from root document (id in query string),
rather than from the document in which the component is inserted. If no value can
be retrieved from the query string, this option will be ignored.
AllowNonMLCParent
Unchecking this parameter will cause an error message to be displayed if the root
document or the inserted document (depending on the parameter UserRoot)
is not a member of a MLC.
CheckLangCookie
Checks the cookie named "CS_Language" for a language code to use for the current
language. This parameter overrides UseRoot. If no value can be retrieved
from the cookie, the component will try to get a valid language code from the document
instead. This parameter can be overridden by the value of "lang" in the query string.
Cache methods
No cache
Do not cache the result from the xml query.
Use application cache
Cache the result from the xml query using application variables. WARNING there are security problems
with this parameter. See the Remarks section for more
information.
Application cache timeout
Timeout in minutes for application cache, 0 = no timeout
Remarks
Security Warning
If the component cache method is set to Use application cache, and the
xml query items contain security permissions which might differ among visitors,
a potential security problem exists. If a user that has high level access visits
the page where this component resides and the result is cached, a user with restricted
access that visits the page at a later time might be able to get hold of information
which should be inaccessible to him/her.
This component bypasses the built in restriction policy that prevents trusted users
from writing code that can execute on the server side. For this reason you should
not make this component available to user that has not the right to write programming
code (see the
GlobalRights
WriteActiveContent global right for more information).
Never include this component in a document that is ment to be edited by regular
users - this will force you to give them access to this component. To protect this
component from illegitimate use, restrict permission on the component itself to
developers only.